<?php
/**
 * @author baby&star
 *
 *
 */
class StartController extends Controller{
	//TODO - Insert your code here
	function actionIndex(){
		set_time_limit(0);
		$shopBrand = new Shop_brand();
		$rs = $shopBrand->getList("`status` = 0 "," id desc ",1);
		$rs = $rs["data"][0];
		//$rs['blockDelimiter'] = '/<li>\s*<div\s+class=\"item\">\s*<div\s+class=\"pic\">/';
		//$rs['pricePattern']   = "/<strong>(.+)\s+元<\/strong>/";
		//$rs['titlePattern']   = "/style=\"\">\s+(.+)\s+<\/a>/";
		//$rs['imgPattern']     = "/<img\s+data-ks-lazyload=\"(.+)\"\s+\/>/";
		//$rs['hrefPattern']    = "<a\s+target=\"_blank\"\s+href=\"(.+)\"\s+class=\"permalink\"\s+style=\"\">";
		//$rs['pagePattern']    = "/<a\s+class=\"J_SearchAsync\"\s+href=\"(.+)\">([0-9]+)<\/a>/";
		
		
		$basePath =  dirname(__FILE__).DIRECTORY_SEPARATOR;
		
		include_once $basePath.'../extensions/search/sprder.php';
		
		
		include_once $basePath.'../extensions/search/Search.php';
		$url = "http://store-us.hugoboss.com/accessories/womens-watches/14800,en_US,sc.html";
		$search = new Search($url,12);
		$search->start();
		exit;
		
		//
		//print_r($rs);exit;
		switch($rs["type"]){
			case "1":
				$sprder = new sprder($rs);
				$sprder->run();
				break;
			case "2":
				include_once $basePath.'../extensions/search/belle.php';
				$belle = new belle($rs);
				$belle->start();
				break;
			case "3":
				include_once $basePath.'../extensions/search/Singel.php';
				$single = new Singel($rs);
				$single->start();
				break;
			default:
				break;
		}
	
		
		
		
		exit;
	}
	/**
	 * 折扣速递
	 * Enter description here ...
	 */
	public function actionZksd(){
		//echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
		set_time_limit(0);
		$basePath =  dirname(__FILE__).DIRECTORY_SEPARATOR;
		
		include_once $basePath.'../extensions/search/zksd.php';
		
		$zksd = new zksd();
		
		$zksd->start();
	}
}


?>